package com.uwo.house.dao;

import com.uwo.house.beans.User;
import com.uwo.house.beans.request.AddStaffReq;
import com.uwo.house.beans.request.ClientModifyReq;
import com.uwo.house.beans.request.ModifyStaffReq;
import com.uwo.house.beans.response.StaffUserResp;
import com.uwo.house.beans.response.UserResp;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * Created by yanhao on 2017/7/13.
 */
@Repository
public interface UserMapper {

    User selectByUsername(String username);

    User selectByMobile(String mobile);

    User selectByEmail(String email);

    User selectById(String id);

    int save(User user);

    int modify(User user);

    List<UserResp> getUsers(@Param("userName") String userName, @Param("dateFrom") Date dateFrom, @Param("dateTo") Date dateTo);

    int deleteUser(String id);

    List<StaffUserResp> getStaffList(@Param("roleId") int roleId, @Param("userName") String userName, @Param("name") String name,
                                     @Param("address") String address, @Param("supplyClass") String supplyClass);

    int modifyStaffUser(ModifyStaffReq modifyStaffReq);

    int addStaffUser(AddStaffReq addStaffReq);

    int addRole(@Param("userId") String userId, @Param("roleId") int roleId);

    UserResp getUserByUserName(String username);

    User getUserByMobile(String mobile);

    String getRoleIdByUserId(String userId);

    int checkMobile(String mobile);

    String getNameByUserId(String userId);

    StaffUserResp getStaffUserInfo(String userId);

    int modifyClientInfo(ClientModifyReq clientModifyReq);

    int modifyStaffPassword(User user);

    int modifyAliAccount(@Param("aliAccount") String aliAccount, @Param("userId") String userId);
}
